using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
using System.Xml.Serialization;

[XmlTypeAttribute(TypeName="Contact")]
public class Contact {
  private int m_Id;
  private string m_ContactName;
  private string m_Street;
  private string m_City;
  private string m_ZipCode;
  private string m_Country;
  private decimal? m_Longitude;
  private decimal? m_Latitude;
  private string m_ResponseText;
  private ResponseType m_ResponseType;
  private decimal m_Product1;
  private decimal m_Product2;
  private decimal m_Product3;

  [XmlAttribute(AttributeName="ID")]
  public int Id {
    get { return m_Id; }
    set { m_Id = value;}
  }

  [XmlAttribute(AttributeName="ContactName")]
  public string ContactName {
    get { return m_ContactName; }
    set { m_ContactName = value;}
  }

  [XmlAttribute(AttributeName="Street")]
  public string Street {
    get { return m_Street; }
    set { m_Street  =value;}
  }

  [XmlAttribute(AttributeName="City")]
  public string City {
    get { return m_City; }
    set { m_City = value;}
  }

  [XmlAttribute(AttributeName="Country")]
  public string Country {
    get { return m_Country; }
    set { m_Country = value; }
  }

  [XmlAttribute(AttributeName="ZIP")]
  public string ZipCode {
    get { return m_ZipCode; }
    set { m_ZipCode = value; }
  }

  [XmlIgnore()]
  public decimal? Latitude {
    get { return m_Latitude; }
    set { m_Latitude = value; }
  }

  [XmlIgnore()]
  public decimal? Longitude {
    get { return m_Longitude; }
    set { m_Longitude = value; }
  }

  [XmlAttribute(AttributeName="Response")]
  public string ResponseText {
    get { return m_ResponseText; }
    set { 
      m_ResponseText = value;
      m_ResponseType = ResponseType.Parse(value);
    }
  }

  [XmlAttribute(AttributeName = "Product1")]
  public decimal Product1 {
    get { return m_Product1; }
    set { m_Product1 = value; }
  }

  [XmlAttribute(AttributeName = "Product2")]
  public decimal Product2 {
    get { return m_Product2; }
    set { m_Product2 = value; }
  }

  [XmlAttribute(AttributeName = "Product3")]
  public decimal Product3 {
    get { return m_Product3; }
    set { m_Product3 = value; }
  }

  public string Address {
    get { return m_Street + " , " + m_City + " , " + m_Country; }
  }

  public ResponseType ResponseType {
    get { return m_ResponseType; }
  }
}
